@import '../../variables.less';

@cur-primary-color: #b2e281;
.chat_notice {
	width: 100%;
	color: @primary-color;
	text-align: center;
	margin-top: 10px;
	margin-bottom: 10px;
	span {
		background-color: #cecece;
		line-height: 25px;
		border-radius: 2px;
		padding: 1px 5px;
		font-size: 12px;
	}
}
.chat_item_content {
	width: 100%;
	display: flex;
	.avatar {
		display: flex;
		justify-content: center;
		img {
			width: 35px;
			height: 35px;
		}
	}
	.content_text {
		display: block;
		position: relative;
		max-width: 300px;
		padding: 5px;
		word-wrap: break-word;
		white-space: pre-wrap;
		border-radius: 4px;
		flex-shrink: 0;
		min-height: 35px;
		align-self: flex-start;
	}
	.content_text::before {
		content: '';
		display: inline-block;
		width: 0;
		height: 0;
		border: 10px solid transparent;
		position: absolute;
		top: 5px;
	}
	.content_video {
		object-fit: cover;
		position: relative;
		text-align: center;
		img {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			width: 30px;
			height: 30px;
			cursor: pointer;
		}
	}
	.content_file {
		width: 180px;
		height: 70px;
		display: flex;
		background-color: @primary-color;
		position: relative;
		.content_file_name {
			flex: 1.5;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			span:nth-child(1) {
				font-size: 16px;
				color: @font-color;
				padding-left: 10px;
				max-width: 108px;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
			span:nth-child(2) {
				font-size: 12px;
				color: @font-color-lightest;
			}
		}
		.content_file_img {
			flex: 1;
			display: flex;
			justify-content: center;
			align-items: center;
			img {
				width: 40px;
			}
		}
	}
	.content_file::before {
		content: '';
		display: inline-block;
		width: 0;
		height: 0;
		border: 10px solid transparent;
		position: absolute;
		top: 5px;
	}
	.content_file:hover {
		background-color: @shadow-border_bg-color;
		cursor: pointer;
	}
	.content_delete {
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: @font-color-lightest;
		img {
			width: 40px;
		}
	}
	.content_delete:hover {
		background-color: @primary-color;
		cursor: default;
	}
}
.other {
	justify-content: flex-start;
	.avatar {
		margin-left: 20px;
	}
	.content_text {
		background: @primary-color;
		margin-left: 10px;
	}
	.content_text::before {
		border-right: 8px solid @primary-color;
		left: -17px;
	}
	.content_video {
		margin-left: 10px;
	}
	.content_file {
		margin-left: 10px;
	}
	.content_file::before {
		border-right: 8px solid @primary-color;
		left: -17px;
	}
	.content_image {
		margin-left: 10px;
	}
}
.self {
	justify-content: flex-end;
	.avatar {
		margin-right: 20px;
	}
	.content_text {
		background: @cur-primary-color;
		margin-right: 10px;
	}
	.content_text::before {
		display: inline-block;
		width: 0;
		height: 0;
		border: 10px solid transparent;
		border-left: 8px solid @cur-primary-color;
		position: absolute;
		right: -17px;
		top: 5px;
	}
	.content_video {
		margin-right: 10px;
	}
	.content_file {
		margin-right: 10px;
	}
	.content_file::before {
		display: inline-block;
		width: 0;
		height: 0;
		border: 10px solid transparent;
		border-left: 8px solid @primary-color;
		position: absolute;
		right: -17px;
		top: 5px;
	}
	// :global {
	// 	.content_image {
	// 		margin-right: 10px;
	// 	}
	// }
}
